#pragma once
#include <list>
#include <vector>
#include <Windows.h>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <MMSystem.h>
#include <string>
#include <cmath>

using namespace std;

class graphClass
{
private:
    int period;
        vector<double>::iterator ii;
    vector<double> values;
    ifstream input;
    MMRESULT timer;
        COLORREF color;
    bool valid;
    bool started;
    wstring filePath;  //string, char* or whatever
    HWND hWnd;
    HWND hCtrl;        //CONTROL for graph. mamma mia..... (and also ID for deleting (to bind *graph and list iterator))
        int xScale;
        int yScale;
        int xOffset;
        int yOffset;
        double maxValue;
        double minValue;
        bool visible;
public:
    graphClass(const graphClass &copy);
    graphClass(const wstring filePathIN, COLORREF colorIN, HWND hWndIN);    //string, char* or whatever
    ~graphClass();
    void start();
    void stop();
    int getPeriod(); 
    void loadValue();//completely useless...delete?
    bool startReading();
    double readNext();
    void sendMes();
    int getLength();
        void setXScale(int);
        void setYScale(int);
        void setXOffset(int);
        void setYOffset(int);
        int getXScale();
        int getYScale();
        int getXOffset();
        int getYOffset();
        double getMax();
        double getValue(int i);
        void show();
        void hide();
        bool isVisible();
        bool isStarted();
    COLORREF getColor();
        HWND getHCtrl();
        void setHCtrl(HWND hWnd);
    };

void CALLBACK timerProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2);

